using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ApplicationBlocks.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DataHelper.DAL
{
    public class BK_Booking
    {
private static  string m_trConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

       #region BK_BookingSelectAll
        public static SqlDataReader BK_BookingSelectAll(string strSearch="",int top = 1, int bottom = 20, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "BK_BookingSelectAllRows",strSearch,top,bottom);
            return SqlHelper.ExecuteReader(m_trConnectionString, "BK_BookingSelectAllRows",strSearch,top,bottom);
        }
        #endregion
       #region BK_BookingSelectRow
        public static SqlDataReader BK_BookingSelectRow(int ID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "BK_BookingSelectRow", ID);
            return SqlHelper.ExecuteReader(m_trConnectionString, "BK_BookingSelectRow", ID);
        }
        #endregion
       #region BK_BookingInsertRow
        public static void BK_BookingInsertRow(int ID, string SessionID, int Status, int TotalPrice, string FromCity, string ToCity, string FlightDepart, string FlightReturn, int Ways, int Amount, string Name, string Phone, string Address, string Email, string Note, string IP, DateTime CreatedDate, string UpdatedUser, DateTime UpdatedDate, string DeletedUser, DateTime DeletedDate, bool IsDeleted, string rTotal, string rCode, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "BK_BookingInsertRow", ID, SessionID, Status, TotalPrice, FromCity, ToCity, FlightDepart, FlightReturn, Ways, Amount, Name, Phone, Address, Email, Note, IP, CreatedDate, UpdatedUser, UpdatedDate, DeletedUser, DeletedDate, IsDeleted, rTotal, rCode);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "BK_BookingInsertRow", ID, SessionID, Status, TotalPrice, FromCity, ToCity, FlightDepart, FlightReturn, Ways, Amount, Name, Phone, Address, Email, Note, IP, CreatedDate, UpdatedUser, UpdatedDate, DeletedUser, DeletedDate, IsDeleted, rTotal, rCode);
        }
        #endregion
       #region BK_BookingUpdateRow
        public static void BK_BookingUpdateRow(int ID, string SessionID, int Status, int TotalPrice, string FromCity, string ToCity, string FlightDepart, string FlightReturn, int Ways, int Amount, string Name, string Phone, string Address, string Email, string Note, string IP, DateTime CreatedDate, string UpdatedUser, DateTime UpdatedDate, string DeletedUser, DateTime DeletedDate, bool IsDeleted, string rTotal, string rCode, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "BK_BookingUpdateRow", ID, SessionID, Status, TotalPrice, FromCity, ToCity, FlightDepart, FlightReturn, Ways, Amount, Name, Phone, Address, Email, Note, IP, CreatedDate, UpdatedUser, UpdatedDate, DeletedUser, DeletedDate, IsDeleted, rTotal, rCode);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "BK_BookingUpdateRow", ID, SessionID, Status, TotalPrice, FromCity, ToCity, FlightDepart, FlightReturn, Ways, Amount, Name, Phone, Address, Email, Note, IP, CreatedDate, UpdatedUser, UpdatedDate, DeletedUser, DeletedDate, IsDeleted, rTotal, rCode);
        }
        #endregion
       #region BK_BookingDeleteRow
        public static void BK_BookingDeleteRow(int ID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "BK_BookingDeleteRow", ID);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "BK_BookingDeleteRow", ID);
        }
        #endregion

    }
}

